#!/usr/bin/perl -w # For syntax highlighting
package clreqd_modules;

use strict;
use vm_info;

sub vm_check {
my %ARGS=@_;

	my $type=$ARGS{TYPE};
	my $vm_info=new vm_info($type);
	if(!defined($vm_info)) {
		return "FAIL " . vm_info::error();
	}
	my $cmd=$vm_info->get_field("check");
	if(!defined($cmd)) {
		return "FAIL " . vm_info::error();
	}
	if(substr($cmd,0,1) ne "/") {
		$cmd="$::ENV{TRUECL_CODE}/$cmd";
	}
	local $SIG{CHLD}='DEFAULT';
	my $err=`$cmd 2>&1 </dev/null`;
	chomp($err) if defined($err);
	my $rc=$?>>8;
	if($rc==0) {
		return "OK YES";
	}
	return "OK NO $err";
}

1;
